import account_api
import requests


def getImages(house_id):
    """获取房源图片对象

    Args:
        house_id (_type_): _description_

    Returns:
        _type_: _description_
    """
    url = f'http://erp.fangline.cn/house/getHouseImgList.json?houseId={house_id}'
    response = requests.post(url, headers=account_api.getHeaders())

    images = response.json()['indoorImg']
    if len(response.json()['outdoorImg']) > 0:
        images.extend(response.json()['outdoorImg'])
    if len(response.json()['houseTypeImg']) > 0:
        images.extend(response.json()['houseTypeImg'])

    return images
